﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Domain;
using Repository;
using Controller;

namespace Ecommerce
{
    public partial class FormularioPrincipal : Form
    {

        private Produto produto = new Produto();
        private Cliente cliente;

        public Cliente Cliente 
        {
            get { return this.cliente; }
            set { this.cliente = value; }
        }
        public FormularioPrincipal()
        {
            InitializeComponent();
            menuStrip1.Enabled = false;
            toolStripStatusLabel1.Visible = false;
        }

        public FormularioPrincipal(Cliente cliente)
        {
            this.cliente = cliente;
            InitializeComponent();
            toolStripStatusLabel1.Text = "Usuário : "+cliente.Nome;
            
        }


        public void PreparaFormulario(Cliente cliente) 
        {
            this.cliente = cliente;
        menuStrip1.Enabled = true;
        toolStripStatusLabel1.Visible = true;
        toolStripStatusLabel1.Text = "Usuário: " + cliente.Nome;
        }

        private void FormularioPrincipal_Load(object sender, EventArgs e)
        {
            Login login = new Login(this);
            login.MdiParent = this;
            login.Show();
            
            
        }

        private void relatorioToolStripMenuItem_Click(object sender, EventArgs e)
        {
           
        }

        private void statusStrip1_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
        {

        }

        private void toolStripStatusLabel1_Click(object sender, EventArgs e)
        {

        }

        private void novoToolStripMenuItem_Click(object sender, EventArgs e)
        {
           
        }

        private void button1_Click(object sender, EventArgs e)
        {

        }

        private void button2_Click(object sender, EventArgs e)
        {
         
        }

        private void groupBox3_Enter(object sender, EventArgs e)
        {

        }

        private void textBox2_TextChanged(object sender, EventArgs e)
        {

        }

        private void textBox4_TextChanged(object sender, EventArgs e)
        {

        }

        private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {

        }

        private void dataGridView1_SelectionChanged(object sender, EventArgs e)
        {
        
        }

        private void button3_Click(object sender, EventArgs e)
        {
            

        }

        private void button4_Click(object sender, EventArgs e)
        {
        
        }

        private void button5_Click(object sender, EventArgs e)
        {
        
        }

        private void button6_Click(object sender, EventArgs e)
        {
        
        }

        private void psNome_TextChanged(object sender, EventArgs e)
        {

        }

        private void cadastroToolStripMenuItem_Click(object sender, EventArgs e)
        {

        }

        private void alterarToolStripMenuItem_Click(object sender, EventArgs e)
        {

        }

        private void logoutToolStripMenuItem_Click(object sender, EventArgs e)
        {

        }

        private void usuarioToolStripMenuItem_Click(object sender, EventArgs e)
        {
        NovoUsuario novousuario = new NovoUsuario();
        novousuario.MdiParent = this;
        novousuario.Show();
        }

        private void toolStripSplitButton1_ButtonClick(object sender, EventArgs e)
        {

        }

        private void produtoToolStripMenuItem_Click(object sender, EventArgs e)
        {
            NovoProduto novoProduto = new NovoProduto();
            novoProduto.MdiParent = this;
            novoProduto.Show();
        }

        private void fornecedorToolStripMenuItem_Click(object sender, EventArgs e)
        {
            NovoFornecedor nf = new NovoFornecedor();
            nf.MdiParent = this;
            nf.Show();
        }

        private void compraToolStripMenuItem_Click(object sender, EventArgs e)
        {
            NovaCompra nc = new NovaCompra(this.cliente);
            nc.MdiParent = this;
            nc.Show();
        }
    }
}
